package com.cloudbroker.bcs.platform.ltb.common.constant.type;

/**
 * 校验码业务类型
 * */
public enum AuthMsgBusiType {

	RESER_PROBLEM("1", "预留问题"),
	RESET_PASSWORD("2" , "重置密码"),
	REGISTER("3" , "注册"),
	LOGIN("4" , "登录"),
	MODIFY_PASSWORD("5" , "修改密码"),
	AUTHEN_INFO("6" , "认证信息");
	
	private final String val;
    private final String description;
    private String toString;
    
    private AuthMsgBusiType(String val, String description) {
        this.val = val;
        this.description = description;
    }
    public String getVal() {
        return val;
    }
    
    public String getDescription() {
        return description;
    }
    @Override
    public String toString() {
        if (null == toString) {
            toString = new StringBuilder().append("LoginWay[").append(val).append(':').append(description)
                    .append(']').toString();
        }
        return toString;
    }
    
    public static AuthMsgBusiType getByVal(String val) {
    	for (AuthMsgBusiType type : AuthMsgBusiType.values()) {
			if( type.getVal().equals(val) ) {
				return type;
			}
		}
    	return null;
    }
}
